package com.sakiko.ioc_01;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.sql.SQLException;

@Component // <bean id="userService" class="com.sakiko....."
public class UserService {

    @Value("007") // value = "7"
    private Integer id;
    @Autowired // ref = "userDao"
    private UserDao userDao;

    public void findAll() throws SQLException {
        userDao.queryAll();
    }
    public void showId(){
        System.out.println("Value赋值: "+this.id);
    }
}
